﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WeatherBar2
{
    public partial class ChangeLocation : Form
    {
        public ChangeLocation()
        {
            InitializeComponent();
        }

        private void button3_Click(object sender, EventArgs e)
        {
            USLocation usLocation = new USLocation();
            usLocation.ShowDialog(this);
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(txtLocation.Text.Trim()))
            {
                Properties.Settings.Default.Location = txtLocation.Text;
                Properties.Settings.Default.Save();

                ((Main)this.Owner).pnlRefresh.Visible = true;
                ((Main)this.Owner).DoWork();

                this.Close();

            }

        }
    }
}
